package task

import manager.HttpRequestManager
import manager.TaskManager


class QueryPayTask : Runnable {

    companion object {
        private val Timeout = 10 * 60 * 1000L
        val Instance = QueryPayTask()

        fun Start() {

        }

        fun Stop() {
            Instance.cancelFlag = false
        }
    }

    @Volatile
    var cancelFlag = false

    override fun run() {
        if (cancelFlag) {
            return
        }
        try {
            exec()
        } catch (e: Exception) {
            e.printStackTrace()
        }
        TaskManager.AsyncHandler.postDelayed(this, Timeout)
    }

    private fun exec() {
        val ret = HttpRequestManager.queryPay()

    }
}
